package com.huidu.bitrade.vo;

import com.alibaba.fastjson2.JSON;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.huidu.bitrade.entity.BusinessDepositStrategy;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class OtcBusinessRealizationVO {

    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    private Long memberId;
    private String memberUsername;
    private String memberRealName;
    private String phone;
    private String reason;
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date auditTime;
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date payTime;
    @ApiModelProperty("交易金额")
    private BigDecimal amount;
    private Integer status;
    @ApiModelProperty("凭证")
    private String image;
    @ApiModelProperty("支付信息")
    private MemberAccountVO memberAccountVO;
    @Transient
    private Long acceptDepositId;

    private BusinessDepositStrategy businessDepositStrategy;


    @JsonIgnore
    @ApiModelProperty(hidden = true)
    private String payInfo;

    public void setPayInfo(String payInfo) {
        this.memberAccountVO = JSON.parseObject(payInfo,MemberAccountVO.class);
        this.payInfo = payInfo;
    }
}
